package com.yulan.fastkillcourse.mq;


import com.yulan.fastkillcourse.redis.RedisService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.concurrent.atomic.AtomicInteger;

@Service
public class MQSender {
    private static Logger log = LoggerFactory.getLogger(MQSender.class);

    @Autowired
    AmqpTemplate amqpTemplate ;

    public void sendFastKillMessgae(FastKillMessage mm) {
        String msg = RedisService.beanToString(mm);
        log.info("send message:"+msg);
           amqpTemplate.convertAndSend(MQConfig.FASTKILL_QUEUE1, msg);

    }

}
